package lancooUpLoad;

import android.util.Log;

import com.example.lancooznbk.service.HttpPostServer;
import com.lancoo.rxretrofitlibrary.Api.BaseApi;
import com.lancoo.rxretrofitlibrary.listener.HttpOnNextListener;
import com.trello.rxlifecycle.components.support.RxAppCompatActivity;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by Administrator on 2017/8/23/023.
 */

public class SaveParam extends BaseApi {


    private SaveDataJson mSaveDataJson;

    public SaveDataJson getSaveDataJson() {
        return mSaveDataJson;
    }

    public void setSaveDataJson(SaveDataJson SaveDataJson) {
        this.mSaveDataJson = SaveDataJson;
    }

    public SaveParam(HttpOnNextListener listener, RxAppCompatActivity rxAppCompatActivity) {
        super(listener, rxAppCompatActivity);
    }

    @Override
    public Observable getObservable(Retrofit retrofit) {
        HttpPostServer httpPostServer = retrofit.create(HttpPostServer.class);
       // Gson gson = new Gson();
        //String saveJsonStr = gson.toJson(mSaveDataJson);
        Log.e(">>>>>>>>>ItemCount>>", ":"+PaperInfor.PaperAnsweredItemCount);
//        Log.e(">>>>>111>>>>Duration>>", ":"+PaperInfor.PaperDuration);
        return httpPostServer.saveDataJson(PaperInfor.PaperAnsweredItemCount,
                PaperInfor.PaperDuration, mSaveDataJson);
    }
}